<script type="text/javascript">
function invitation_accepted(){
	$('invite_btn').hide();
	$("inviteForm").request({
		onComplete: function(transport){
			var ret = transport.responseText.evalJSON();
			if(ret.result){
				location.href = "/?" + $H({_app: 'friends', _controller: 'index', _action: 'get_list', friend: 1}).toQueryString();
			}else{
				new MessageBox(MessageBox.TYPE_MESSAGE, ret.reason, '提示', {close:function(){}});
				$('invite_btn').show();
			}
			
		}
	});
}
</script>

<div class="invited column">
<h1><?= $this->ret['data']['username']?>邀请您成为<?=$this->getThe()?>的好友</h1>
<div class="avatar120"><img src="<?=member_util_avatar::get_avatar($this->ret['data']['id'], 'mid')?>"/></div>
<h2 class="red">Hello，我是<?= $this->ret['data']['username']?>！</h2>
<p class="standardp">欢迎来到漫画国际,在这里你可以找到恭喜喜爱漫画的朋友，了解他们的最新动态，结识新朋友和朋友分享漫画、文章。
<?if ($this->ret['data']['txt']):?>
<br/>
<br/>　　<?= $this->ret['data']['username']?>的附言：<?= htmlcontent($this->ret['data']['txt'])?>
<?else:?>	
<?endif;?></div><!--invite_text-->
</p>
<div class="rightfix">
<?if(self::$login):?>
	<form id='inviteForm' method="post" action="/">
	<input type='hidden' name='_app' value='friends'>
	<input type='hidden' name='_controller' value='invitation'>
	<input type='hidden' name='_action' value='invite'>
	<input type='hidden' name='uid' value='<?= $this->uid?>'>
	<input type='hidden' name='invite_code' value='<?= friends_util_invitation::genCode($this->getUid(), $this->ret['data']['code'], self::$login['uid'])?>'>
	</form>
	<a href="javascript: void(invitation_accepted())" target="_self" class="cbtn1" id='invite_btn'>接受邀请</a>
<?endif;?>
<a href="<?=self::_makeURL('member','index','reg')?>&to=<?= urlencode('http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'])?>" class="cbtn">注册并加<?= $this->ret['data']['username']?>为好友</a>
<?if(!self::$login):?><a class="cbtn"  href="<?=self::_makeURL('member','login','login')?>?to=<?= urlencode('http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'])?>">登录</a><? endif;?>
</div>
</div>